import cache from '@/utils/cache'
const PrivacyProtocol = {
  needAuthorization: false,
  privacyContractName: ''
}
export function checkUserPrivacyProtocol() {
  if (wx.getPrivacySetting) {
    wx.getPrivacySetting({
      success: (res: any) => {
        console.log('协议显示的值', res)
        PrivacyProtocol.needAuthorization = res.needAuthorization
        // if (res.needAuthorization) {
        // 需要弹出隐私协议
        PrivacyProtocol.privacyContractName = res.privacyContractName
        // }
        cache.set('PrivacyProtocol', PrivacyProtocol)
      }
    })
  }
}
export function getUserPrivacyProtocol() {
  return cache.get('PrivacyProtocol')
}
